<script setup>
  import {ref} from "vue";

  const edu=ref('本科');
  const price=ref('');
  const arr=ref([
    {title:"五粮液",price:500},
    {title:"茅台",price:2500},
    {title:"梦之蓝",price:368},
    {title:"汾酒",price:330}
  ]);
  const pri=ref('2500')
</script>

<template>
  <h1>单选组件</h1>
  <el-radio-group v-model="edu">
  <el-radio-button value="高中">学历:高中</el-radio-button>
  <el-radio-button label="学历:大专" value="大专"></el-radio-button>
  <el-radio label="学历:本科" value="本科"></el-radio>
  <el-radio label="学历:硕士" value="硕士"></el-radio>
  </el-radio-group>
  <h4>您选择的学历是:{{edu}}</h4>
  <hr>
  <el-radio-group v-model="price">
    <el-radio-button label="五粮液" value="500"></el-radio-button>
    <el-radio-button label="茅台" value="2500"></el-radio-button>
    <el-radio-button label="梦之蓝" value="368"></el-radio-button>
    <el-radio-button label="汾酒" value="330"></el-radio-button>
  </el-radio-group>
  <h4>您选择的酒价为:{{price}}</h4>
  <hr>
  <el-radio-group v-model="pri">
  <el-radio-button v-for="p in arr" :label="p.title" :value="p.price" ></el-radio-button>
  </el-radio-group>
  <h4>您选择的酒价为:{{pri}}</h4>
</template>

<style scoped>

</style>